﻿using System;

namespace ART.Admini.Setting
{
    public partial class DictionaryView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
        private void InitData()
        {
            if (DictionaryId > 0)
            {
                Model.M_dictionary model = new BLL.B_dictionary().GetModel(this.DictionaryId);

                this.txtDictionaryName.Text = model.DictionaryName;
                if (model.ParentId==0)
                {
                    this.dropParentId.Text = "";
                }
                else
                {
                    this.dropParentId.Text = new BLL.B_dictionary().GetModel(model.ParentId).DictionaryName;
                }
                
                this.txtSort.Text = model.Sort.ToString();
            }
        }
        protected int DictionaryId
        {
            get
            {
                int result = 0;
                int.TryParse(base.Request.QueryString["DictionaryId"], out result);
                return result;
            }
        }
    }
}
